package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * ClassName: ShoppingCartMapper
 * Package: com.sky.mapper
 * Description:
 *
 * @Author Dylan_Jun
 * @Create 2024/2/19 16:40
 * @Version 1.0
 */
@Mapper
public interface ShoppingCartMapper {

    List<ShoppingCart> list(ShoppingCart shoppingCart);

    void insert(ShoppingCart shoppingCart);

    void updateNumberById(ShoppingCart cart);

    @Delete("delete from shopping_cart where user_id = #{userId}")
    void cleanAll(Long userId);

    @Delete("delete from shopping_cart where id = #{id}")
    void deleteById(ShoppingCart cart);
}
